<section style="overflow-y: scroll;" class="Hui-article-box">
    <div class="panel panel-default">
	<div class="panel-header">会议列表</div>
        <div class="panel-body">
            <article class="cl">
                <div class="cl pd-5 bg-1 bk-gray mt-20">
                    <span class="l"> 
                        <a href="javascript:;" onclick="layer_show('添加会议', '/admin/meeting/add')" class="btn btn-primary radius">
                            <i class="Hui-iconfont">&#xe600;</i>添加会议
                        </a> 
                    </span>
                </div>
                <div style="padding:20px 0;">
                    使用说明：</br>
                    1、用户可通过<span style="color:red;"> 报名链接 </span>或<span style="color:red;"> 报名二维码 </span>进入报名页面</br>
                    2、会议现场需要使用的签到iPad,需要提前打开签到APP扫描<span style="color:red;"> 会议登录码 </span>登录对应会议
                </div>
                <table class="table table-border table-bordered table-bg">
                    <thead>
                        <tr>
                            <th scope="col" colspan="9">列表</th>
                        </tr>
                        <tr class="text-c">
                            <th width="40">会议ID</th>
                            <th width="40">主图</th>
                            <th width="90">会议名称</th>
                            <th width="90">报名链接</th>
                            <th width="90">报名二维码</th>
                            <th width="90">创建时间</th>
                            <th width="90">会议登录码</th>
                            <th width="100">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($datalist as $k=>$v){ ?>
                        <tr class="text-c">
                            <td>{$v['id']}</td>
                            <td><img src="{$v['headimage']}" style="width:78px;"/></td>
                            <td><?=$v['meeting_name']?></td>
                            <td><a target="_blank" href="{:url('index/meeting/index')}?token=<?php echo $v['token']?>">
                            http://sign.gogogo.club/index/meeting/index?token={$v["token"]}
                            </a></td>
                            <td>
                                <img    width="78" src="http://qr.liantu.com/api.php?bg=f3f3f3&fg=ff0000&gc=222222&el=l&w=200&m=10&text=http://sign.gogogo.club/index/meeting/index?token={$v['token']}" alt="">
                            </td>
                            <td><?=$v['create_time']?></td>
                            <td><img width="78"  src="http://qr.liantu.com/api.php?bg=f3f3f3&fg=ff0000&gc=222222&el=l&w=200&m=10&text={$v['qrcode_url']}" style="width:78px;"/></td>
                            <td>
                                <a onclick="layer_show('编辑', '/admin/meeting/add?id={$v["id"]}')" 
                                    class="ml-5 btn radius btn-primary">
                                     <i class="Hui-iconfont">&#xe6df;</i>编辑
                                 </a> 
                                 <a onclick="del(this, '{$v['id']}')" class="btn radius btn-danger">
                                     <i class="Hui-iconfont">&#xe6e2;</i>删除
                                 </a>
                            </td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
                <div><?php echo $pager;?></div>
            </article>
        </div>
    </div>
    <div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
        <div id="innerdiv" style="position:absolute;">
            <img id="bigimg" style="border:5px solid #fff;" src="" />
        </div>
    </div> 
</section>
<script type="text/javascript" src="/static/lib/laypage/1.2/laypage.js"></script> 
<script type="text/javascript">
function del(obj,id){
    layer.confirm('确认要删除吗？',function(index){
        $.get('/admin/meeting/del?id='+id).then(function(res){
            if(res.code==0) {
                layer.msg(res.msg,{icon:1,time:1000});
                $(obj).parents("tr").remove();
            }else{
                layer.msg(res.msg);
            }
        })
    });
}
function imgShow(outerdiv, innerdiv, bigimg, _this){  
        var src = _this.attr("src");//获取当前点击的pimg元素中的src属性  
        $(bigimg).attr("src", src);//设置#bigimg元素的src属性  
      
            /*获取当前点击图片的真实大小，并显示弹出层及大图*/  
        $("<img/>").attr("src", src).load(function(){  
            var windowW = $(window).width();//获取当前窗口宽度  
            var windowH = $(window).height();//获取当前窗口高度  
            var realWidth = this.width;//获取图片真实宽度  
            var realHeight = this.height;//获取图片真实高度  
            var imgWidth, imgHeight;  
            //缩放尺寸，当图片真实宽度和高度大于窗口宽度和高度时进行缩放  
            var scale = 0.8;
            //判断图片高度    
            if(realHeight>windowH*scale) {
            //如大于窗口高度，图片高度进行缩放  
                imgHeight = windowH*scale;
                //等比例缩放宽度 
                imgWidth = imgHeight/realHeight*realWidth;
                //如宽度扔大于窗口宽度   
                if(imgWidth>windowW*scale) {
                    //再对宽度进行缩放 
                    imgWidth = windowW*scale; 
                }  
            //如图片高度合适，判断图片宽度  
            } else if(realWidth>windowW*scale) {
            //如大于窗口宽度，图片宽度进行缩放  
                imgWidth = windowW*scale;
                //等比例缩放高度  
                imgHeight = imgWidth/realWidth*realHeight;
            } else {
                imgWidth = realWidth;  
                imgHeight = realHeight;  
            }  
            //以最终的宽度对图片缩放  
            $(bigimg).css("width",imgWidth);
            //计算图片与窗口左边距    
            var w = (windowW-imgWidth)/2;
            //计算图片与窗口上边距  
            var h = (windowH-imgHeight)/2;
            //设置#innerdiv的top和left属性  
            $(innerdiv).css({"top":h, "left":w});
            //淡入显示#outerdiv及.pimg  
            $(outerdiv).fadeIn("fast");
        });  
         //再次点击淡出消失弹出层   
        $(outerdiv).click(function(){
            $(this).fadeOut("fast");  
        });  
    }  
$(function() {
    $("img").click(function(){  
            var _this = $(this);//将当前的pimg元素作为_this传入函数  
            imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);  
    });  
})
</script> 
